FROM python:3.12-slim
WORKDIR /app
ENV HF_ENDPOINT="https://hf-mirror.com"
COPY requirements.txt .
RUN pip install --no-cache-dir torch -i https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
    pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN python -c "from bert_score import score; score(['你好'], ['世界'], lang='zh', rescale_with_baseline=True)"
COPY . .